/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __galaxy_h
#define __galaxy_h 1

#include <boost/thread/thread.hpp>
#include <boost/shared_ptr.hpp>

#include <Core/Kernel/ManagerFactory.h>
#include <Util/Types.h>


namespace galaxy {

    //class Consumer;

    namespace logic {
        namespace gamestate {
            class Manager;
        }
    }
    

    /** Game entity class */
    class Galaxy
    {
        //typedef boost::shared_ptr<Consumer>                          ConsumerPtr;
        typedef boost::shared_ptr<galaxy::logic::gamestate::Manager> StateManagerPtr;
       
        //ConsumerPtr        m_Consumer;        /**< the 'galaxy' consumer */
        
        boost::thread_group m_Threads;      /**< threads that are run by the game */

    public:
        Galaxy();
        virtual ~Galaxy();

        bool initialize ();

        /** runs the game */
        void run ();

        virtual bool initializeModules ();
        virtual bool loadInitialGameData ();
        virtual bool setInitialGameState ();

        void signalTerminateGame ();
        virtual bool terminateModules();

    };

} // namespace galaxy

#endif // __galaxy_h
